package com.cyn.aframework.shiro;
public class CodecAndCryptoTest {

    public static void main(String[] args) {
//        String str = "hello";
//        String base64Encoded = Base64.encodeToString(str.getBytes());
//        String str2 = Base64.decodeToString(base64Encoded);
//        System.out.println(base64Encoded);
//        System.out.println(str2);
//        Assert.assertEquals(str, str2);

//        String str = "hello";
//        String base64Encoded = Hex.encodeToString(str.getBytes());
//        String str2 = new String(Hex.decode(base64Encoded.getBytes()));
//        Assert.assertEquals(str, str2);

        String str = "hello";
        String salt = "123";
//        String md5 = new Md5Hash(str, salt).toString();//还可以转换为 toBase64()/toHex()
//        System.out.println(md5);
    }
}
